import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 添加默认播放列表
    playList: {
      id: 2681139,
      name: "意外",
      pic: 109951163830384660,
      picUrl: "https://p2.music.126.net/9A0ob2sGFC8bt3f6EH5vcQ==/109951163830384653.jpg",
      pic_str: "109951163830384653",
    },
    // 默认id
    id: 27955654,
    // 暂停按钮是否显示
    isbtnShow: true,
    // 当前时间
    currentTime: 0,
    // 歌曲总时长
    duration: 0
  },
  getters: {
  },
  mutations: {
    updateIsBtnShow(state, value) {
      // console.log("是否显示",state.isbtnShow);
      state.isbtnShow = value
    },
    updateCurrentTime(state, value) {
      // console.log(this.state.currentTime);
      state.currentTime = value
    },
    updateDuration(state, value) {
      state.duration = value
    }
  },
  actions: {
  },
  modules: {
  }
})
